/*
 * IsInstanceOfPredicate.java
 * 
 * Created on Jun 8, 2007, 11:54:41 PM
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.infomancers.collections.predicates;

import com.infomancers.collections.Predicate;

/**
 *
 * @author aviadbd
 */
public class IsInstanceOfPredicate<T, K> implements Predicate<T> {
    private Class<K> clz;
    
    public IsInstanceOfPredicate(Class<K> clz) {
        this.clz = clz;
    }

    public boolean isTrue(T item) {
        return clz.isAssignableFrom(item.getClass());
    }
}
